package net.comm.user.db;


import java.sql.ResultSet;
import java.sql.SQLException;

import net.comm.user.bean.BaseUserSet;
import net.comm.util.StringUtil;

import org.sakaiproject.db.api.SqlReader;

public class DbUserSetService implements SqlReader
{

	/**
	 * Read from the result one set of fields to create a Resource.
	 * 
	 * @param result
	 *        The Sql query result.
	 * @return The Resource object.
	 */
	public Object readSqlResultRecord(ResultSet result)
	{
		try
		{
			
			int  	userID = result.getInt(1);				//会员ID
			String  picDisflg = StringUtil.getValue(result.getString(2));			//照片显示选项
			String  friendFlg = StringUtil.getValue(result.getString(3));			//谁能加我好友
			String  firendListFlg = StringUtil.getValue(result.getString(4));		//谁能看到我的好友列表
			String  emailFlg = StringUtil.getValue(result.getString(5));				//谁能给我邮件
			String  homeFlg = StringUtil.getValue(result.getString(6));				//主页开放状态
			String  pubOperFlg = StringUtil.getValue(result.getString(7));			//谁能看到我的动态
			String  mTime = StringUtil.getValue(result.getString(8));				//最后修改时间

						
			// create the Resource from these fields
			return new BaseUserSet( userID, picDisflg, friendFlg, firendListFlg, emailFlg, homeFlg, pubOperFlg,mTime );
		}
		catch (SQLException e)
		{
			return null;
		}
		
	}
}
